package com.tinyspot.concrete.starter.business;

import com.tinyspot.concrete.starter.business.processor.CompanyProcessor;
import com.tinyspot.concrete.starter.business.processor.UserBatchProcessor;
import com.tinyspot.concrete.starter.business.processor.UserProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Tinyspot
 * @date 2023-01-07 22:55
 */
@Configuration
public class BatchCommonBizProcessorConfig {

    @Resource
    private UserBatchProcessor userBatchProcessor;

    // @Resource
    // private TransationTemplate transationTemplate;

    @Bean
    public BatchCommonBizProcessor userBatchCommonProcessor() {
        BatchCommonBizProcessor batchProcessor = new BatchCommonBizProcessor();
        List<IProcessor> processorList = new ArrayList<>();
        processorList.add(userBatchProcessor);
        batchProcessor.setProcessorList(processorList);
        return batchProcessor;
    }
}
